import Index from '../views/index.vue'
import User from '../views/User.vue'
import Product from '../views/Product.vue'
import Cart from '../views/Cart.vue'

import { createRouter, createWebHashHistory } from "vue-router";

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        { path: '/', redirect: '/index', meta: {title:"信息"}, name: 'index' },
        { path: '/index', component: Index ,meta: {title:"信息"}},
        { path: '/user', component: User ,meta: {title:"物流"}},
        { path: '/product', component: Product ,meta: {title:"支付"}},
        { path: '/cart', component: Cart,meta: {title:"服务"} },
    

    ]
})
router.beforeEach((to,from,next)=>{
    document.title=to.meta.title
    next()
})
export default router 
